package com.irdstudio.apicenter.frame.core.jdbc.container;

/**
 * 分页查询信息
 * 
 * @author zs.ligm
 * @version 1.0
 * @date 2015-07-20
 */
public class PageInfo {

	public int pageSize = 10;

	public int pageIdx = 1;

	public int recordSize = -1;

	public int beginIdx = 0;

	public int endIdx = 0;

	public int totalPage = 0;

	public void setPageIdx(String pageIdx) {
		try {
			this.pageIdx = Integer.parseInt(pageIdx);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void setPageSize(String pageSize) {
		try {
			this.pageSize = Integer.parseInt(pageSize);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void setRecordSize(int recordSize) {
		this.recordSize = recordSize;
		this.totalPage = recordSize % pageSize > 0 ? (recordSize / pageSize) + 1
				: recordSize / pageSize;
	}

}
